#include<stdio.h>
int main()
{
    int n,i;
    double a[51];
    a[1]=3,a[2]=a[3]=6;
    for(i=4;i<=50;i++)
        a[i]=a[i-2]*2+a[i-1];
    while(scanf("%d",&n)!=EOF)
        printf("%.0lf\n",a[n]);
    return 0;
}
